Optimal. Leaf size=163 \[ \frac {1}{16} b \left (6 a^2+b^2\right ) x-\frac {a \left (2 a^2+33 b^2\right ) \cos ^3(c+d x)}{120 d}+\frac {b \left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 163, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2941, 2748,
2715, 8} \begin {gather*} -\frac {a \left (2 a^2+33 b^2\right ) \cos ^3(c+d x)}{120 d}-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}+\frac {b \left (6 a^2+b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}+\frac {1}{16} b x \left (6 a^2+b^2\right )-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2748
Rule 2941
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \sin (c+d x) (a+b \sin (c+d x))^3 \, dx &=-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}+\frac {1}{6} \int \cos ^2(c+d x) (3 b+3 a \sin (c+d x)) (a+b \sin (c+d x))^2 \, dx\\ &=-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}+\frac {1}{30} \int \cos ^2(c+d x) (a+b \sin (c+d x)) \left (21 a b+3 \left (2 a^2+5 b^2\right ) \sin (c+d x)\right ) \, dx\\ &=-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}+\frac {1}{120} \int \cos ^2(c+d x) \left (15 b \left (6 a^2+b^2\right )+3 a \left (2 a^2+33 b^2\right ) \sin (c+d x)\right ) \, dx\\ &=-\frac {a \left (2 a^2+33 b^2\right ) \cos ^3(c+d x)}{120 d}-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}+\frac {1}{8} \left (b \left (6 a^2+b^2\right )\right ) \int \cos ^2(c+d x) \, dx\\ &=-\frac {a \left (2 a^2+33 b^2\right ) \cos ^3(c+d x)}{120 d}+\frac {b \left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}+\frac {1}{16} \left (b \left (6 a^2+b^2\right )\right ) \int 1 \, dx\\ &=\frac {1}{16} b \left (6 a^2+b^2\right ) x-\frac {a \left (2 a^2+33 b^2\right ) \cos ^3(c+d x)}{120 d}+\frac {b \left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}-\frac {\left (2 a^2+5 b^2\right ) \cos ^3(c+d x) (a+b \sin (c+d x))}{40 d}-\frac {a \cos ^3(c+d x) (a+b \sin (c+d x))^2}{10 d}-\frac {\cos ^3(c+d x) (a+b \sin (c+d x))^3}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.58, size = 138, normalized size = 0.85 \begin {gather*} \frac {-120 a \left (2 a^2+3 b^2\right ) \cos (c+d x)-20 \left (4 a^3+3 a b^2\right ) \cos (3 (c+d x))+b \left (36 a b \cos (5 (c+d x))+5 \left (72 a^2 c+18 b^2 c+72 a^2 d x+12 b^2 d x-3 b^2 \sin (2 (c+d x))-3 \left (6 a^2+b^2\right ) \sin (4 (c+d x))+b^2 \sin (6 (c+d x))\right )\right )}{960 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 158, normalized size = 0.97
method | result | size |
derivativedivides | \(\frac {-\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{3}+3 a^{2} b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+3 a \,b^{2} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )+b^{3} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{6}-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{16}+\frac {d x}{16}+\frac {c}{16}\right )}{d}\) | \(158\) |
default | \(\frac {-\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{3}+3 a^{2} b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+3 a \,b^{2} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )+b^{3} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{6}-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{16}+\frac {d x}{16}+\frac {c}{16}\right )}{d}\) | \(158\) |
risch | \(\frac {3 a^{2} b x}{8}+\frac {b^{3} x}{16}-\frac {a^{3} \cos \left (d x +c \right )}{4 d}-\frac {3 a \,b^{2} \cos \left (d x +c \right )}{8 d}+\frac {b^{3} \sin \left (6 d x +6 c \right )}{192 d}+\frac {3 a \,b^{2} \cos \left (5 d x +5 c \right )}{80 d}-\frac {3 b \sin \left (4 d x +4 c \right ) a^{2}}{32 d}-\frac {b^{3} \sin \left (4 d x +4 c \right )}{64 d}-\frac {a^{3} \cos \left (3 d x +3 c \right )}{12 d}-\frac {\cos \left (3 d x +3 c \right ) a \,b^{2}}{16 d}-\frac {b^{3} \sin \left (2 d x +2 c \right )}{64 d}\) | \(166\) |
norman | \(\frac {-\frac {10 a^{3}+12 a \,b^{2}}{15 d}+\frac {b \left (6 a^{2}+b^{2}\right ) x}{16}-\frac {2 a^{3} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{3} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {3 \left (2 a^{3}+4 a \,b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 \left (5 a^{3}+6 a \,b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (5 a^{3}+12 a \,b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {b \left (6 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}+\frac {b \left (6 a^{2}+b^{2}\right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {3 b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {15 b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {5 b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {15 b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {3 b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {b \left (6 a^{2}+b^{2}\right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {b \left (18 a^{2}+19 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {b \left (18 a^{2}+19 b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {b \left (90 a^{2}-17 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {b \left (90 a^{2}-17 b^{2}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}\) | \(476\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 108, normalized size = 0.66 \begin {gather*} -\frac {320 \, a^{3} \cos \left (d x + c\right )^{3} - 90 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} b - 192 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3}\right )} a b^{2} + 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 12 \, d x - 12 \, c + 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} b^{3}}{960 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 116, normalized size = 0.71 \begin {gather*} \frac {144 \, a b^{2} \cos \left (d x + c\right )^{5} - 80 \, {\left (a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (6 \, a^{2} b + b^{3}\right )} d x + 5 \, {\left (8 \, b^{3} \cos \left (d x + c\right )^{5} - 2 \, {\left (18 \, a^{2} b + 7 \, b^{3}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 340 vs.
\(2 (143) = 286\).
time = 0.51, size = 340, normalized size = 2.09 \begin {gather*} \begin {cases} - \frac {a^{3} \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac {3 a^{2} b x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{2} b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{2} b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 a^{2} b \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {a b^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{d} - \frac {2 a b^{2} \cos ^{5}{\left (c + d x \right )}}{5 d} + \frac {b^{3} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {3 b^{3} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {3 b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {b^{3} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {b^{3} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} - \frac {b^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} - \frac {b^{3} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right )^{3} \sin {\left (c \right )} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 139, normalized size = 0.85 \begin {gather*} \frac {3 \, a b^{2} \cos \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {b^{3} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} - \frac {b^{3} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {1}{16} \, {\left (6 \, a^{2} b + b^{3}\right )} x - \frac {{\left (4 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (3 \, d x + 3 \, c\right )}{48 \, d} - \frac {{\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )}{8 \, d} - \frac {{\left (6 \, a^{2} b + b^{3}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.75, size = 425, normalized size = 2.61 \begin {gather*} \frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a^2+b^2\right )}{8\,\left (\frac {3\,a^2\,b}{4}+\frac {b^3}{8}\right )}\right )\,\left (6\,a^2+b^2\right )}{8\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a^2\,b}{4}+\frac {b^3}{8}\right )+4\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {4\,a\,b^2}{5}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (6\,a^3+12\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^3+\frac {24\,a\,b^2}{5}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {20\,a^3}{3}+8\,a\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (\frac {3\,a^2\,b}{4}+\frac {b^3}{8}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {9\,a^2\,b}{2}+\frac {19\,b^3}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {9\,a^2\,b}{2}+\frac {19\,b^3}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {15\,a^2\,b}{4}-\frac {17\,b^3}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (\frac {15\,a^2\,b}{4}-\frac {17\,b^3}{24}\right )+\frac {2\,a^3}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {b\,\left (6\,a^2+b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{8\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________